package pattern.factory.simplefactory;

/**
 * @author zhang peng yang ming
 * 简单工厂类
 * @create 2018-07-21 21:38
 */
public class SimpleFactory {
    public static Car getCar(String type) {
        if ("tesla".equals(type)) {
            return new Tesla();
        } else if ("jeep".equals(type)) {
            return new Jeep();
        } else {
            return null;
        }
    }
}
